package com.example.smartclassroom.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.smartclassroom.entity.Room;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface RoomMapper extends BaseMapper<Room> {
    /**
     * 根据id查询教室
     */
    @Select("select * from room where id=#{id}")
    Room queryRoomById(Integer id);
    /**
     * 查询所有教室名
     */
    @Select("select id,room_name from room")
    List<Room> queryAllRoomName();
}
